<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var room = {
        name: '安宁',
        phone: '13888888888',
        price: 180
      }
      //
      var p = new Proxy(room, {
        get(target, key) {
          return target[key]
        },
        set() {
          // 不能修改任何数据
          return false
        }
      })
      p.price = 280
      console.log(p)
    </script>
  </body>
</html>
